#include <ostream>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

#define MAX_N 1000
int a[MAX_N + 5], b[MAX_N + 5], idx[MAX_N + 5];

//number: 1234 --> save as: 4321
class BigInt:public vector<int>{
public:
    BigInt(int x){
        this->emplace_back(x);
        proccess_digit();
        return;
    }

    void proccess_digit(){
        for(int i = 0; i < size(); i++){
            if(at(i) < 10) continue;
            if(i + 1 == size()) this->emplace_back(0);
            at(i + 1) += at(i) / 10;
            at(i) %= 10;
        }
        while(size() > 1 && at(size() - 1) == 0) this->pop_back();
        return;
    }

    void operator*=(int x){
        for(int i = 0; i < size(); i++) at(i) *= x;
        proccess_digit();
        return;
    }
    
    bool operator>(const BigInt &a) const{
        if(size()!= a.size()) return size() > a.size();
        for(int i = size() - 1; i >= 0; i--){
            if(at(i) != a[i]) return at(i) > a[i];
        }
        return false;
    }

    BigInt operator/(int x){
        BigInt ret(*this);
        int y = 0;
        for(int i = size() - 1; i >= 0; i--){
            y = y * 10 + at(i);
            ret[i] = y / x;
            y %= x;
        }
        ret.proccess_digit();
        return ret;
    }

};

ostream& operator<<(ostream &out, const BigInt &a){
    for(int i = a.size() - 1; i >= 0; i--) out << a[i];
    return out;
}

// big integer
int main(){
    int n;
    cin >> n;
    for(int i = 0; i <= n; i++){
        cin >> a[i] >> b[i];
        idx[i] = i;
    }
    sort(idx + 1, idx + n + 1,[&](int i, int j) ->bool{
        return a[i] * b[i] < a[j] * b[j];
    });
    BigInt p = a[0], ans = 0, tmp = 0;
    for(int i = 1; i <= n; i++){
        tmp = p / b[idx[i]];
        if( tmp > ans) ans = tmp;
        p *= a[idx[i]];
    }
    cout << ans << endl;
    return 0;
}